package org.example.weather.bigscreen.core.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.example.weather.bigscreen.core.api.dto.AreaDTO;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * Created on 2022-07-22.
 *
 * @author chenyu
 */

@RequestMapping("weather-area")
@Api(value = "地区天气采集状态信息", tags = {"地区天气采集状态信息"})
public interface WeatherAreaApi {
    /**
     * 根据采集状态获取地区信息
     *
     * @param enabled 开启状态
     * @return 地区信息
     */

    @GetMapping("status/areas")
    @ApiOperation(value = "根据采集状态获取地区信息", httpMethod = "GET")
    @ApiResponse(code = 200, message = "接口返回成功")
    List<AreaDTO> selectAll(@RequestParam("enabled") Boolean enabled);

    /**
     * 指定id列表获取天气采集状态
     *
     * @param areaIds 地区id集合
     * @return 地区天气采集状态映射
     */
    @PostMapping("areas/status")
    @ApiOperation(value = "指定id列表获取天气采集状态", httpMethod = "POST")
    @ApiResponse(code = 200, message = "接口返回成功")
    Map<String, Boolean> selectWeatherAreaStatus(@RequestBody List<String> areaIds);

}
